package adc.budget.ui.web.wicket.account;

import java.util.List;

import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;

import adc.app.ui.wicket.BoListPanel;
import adc.app.ui.wicket.model.DomainObjectsDataProvider;
import adc.budget.spec.bo.IAccountType;
import adc.budget.spec.bs.IAccountTypeBs;
import adc.budget.ui.web.wicket.IMsgsMisc;

import com.google.common.collect.Lists;
public class AccountTypeListPanel extends BoListPanel<IAccountType> {

    private static final long serialVersionUID = 1L;

    public AccountTypeListPanel(String id) {
        super(id, new DomainObjectsDataProvider<IAccountType>(IAccountTypeBs.class, new SortParam("name", true)));
    }

    @Override
    protected String[] modifLinkColumnProperty() {
        return new String[]{"name", "name"};
    }

    @Override
    protected IModel<String> modifLinkColumnTitle() {
        return new ResourceModel(IMsgsMisc.NAME);
    }

    @Override
    protected List<IColumn<IAccountType>> additionalColumns() {
        List<IColumn<IAccountType>> l = Lists.newArrayListWithCapacity(1);
        l.add(new PropertyColumn<IAccountType>(new ResourceModel(IMsgsAccount.CREDIT), "credit", "credit"));
        return l;
    }

    

}
